<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
</head>

<body>
    <div>{{user.username}}<a href="/loginout">退出登录</a></div>
    
    <div class="layui-container">
        <a href="/addStudent" class="layui-btn">添加学生</a>
        <table class="layui-table">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>姓名</th>
                    <th>联系方式</th>
                    <th>头像</th>
                    <th>班级名称</th>
                    <th>操作</th>
                    
                </tr>
            </thead>
            <tbody>
                {{ each list value index }}
                <tr>
                    <td>{{ value.id }}</td>
                    <td>{{ value.name }}</td>
                    <td>{{ value.link }}</td>
                    <td><img src="/upload/{{ value.img }}" alt=""></td>
                    <td>{{ value.cname }}</td>
                    <td>
                        <a href="/updateStudent?id={{ value.id }}" class="layui-btn layui-btn-normal">修改</a>
                        <a href="/deleteStudent?id={{ value.id }}" class="layui-btn layui-btn-danger">删除</a>
                    </td>
                </tr>
                {{ /each }}
            </tbody>
        </table>
    </div>
</body>

</html>